 /**
 * @file tal_zigbee_inner.h
 * @brief Common process - API used for SDK inner
 * @version 1.0.0   
 * @date 2021-09-09
 *
 * @copyright Copyright 2018-2021 Tuya Inc. All Rights Reserved.
 *
 */

#ifndef __TAL_FIRMWARE_CFG_H__
#define __TAL_FIRMWARE_CFG_H__


#ifdef __cplusplus
    extern "C" {
#endif

#include "tuya_cloud_types.h"

/**
 * @enum zigbee firmware information struct
 */
typedef struct {
    CHAR_T   name[32];
    CHAR_T   model_id[33];
    CHAR_T   manu_name[33];

    //meta_info
    CHAR_T   capacity[9];
    CHAR_T   pid[18];
    CHAR_T   product_type[33];
    
    UINT8_T  version;
    UINT16_T manu_id;
    UINT16_T image_type;
} TAL_FW_INFO_T;


typedef struct {
    CHAR_T * name;
    CHAR_T * model_id;
    CHAR_T * manu_name;
    CHAR_T * capacity;
    CHAR_T * product_id;
    CHAR_T * product_type;
    UINT8_T  fw_version;
    UINT16_T manu_id;
    UINT16_T image_type;
} TAL_FW_INIT_T;


/**
 * @brief firmware information init
 *
 * @param[in]   model_id:   point to mode id
 * @param[in]   pid_prefix: point to pid prefix
 * @param[in]   pid:        point to pid
 * @param[in]   fw_version: app firmware version
 * @param[in]   manu_id:    manufacturer id
 * @param[in]   image_type: OTA image type
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */
OPERATE_RET tal_firmware_info_init(TAL_FW_INIT_T * init_dcb);

/**
 * @brief firmware information read
 *
 * @param[in]   none
* @return point to firmware information
 */
TAL_FW_INFO_T *tal_firmware_info_read(VOID_T);

/**
 * @brief tuyaos sdk information init
 *
 * @param[in]   sdk_ver:    sdk version
 * @param[in]   kcfg_ver:   kernel kconfig version
 * @param[in]   kernel_ver: kernel version
* @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h
 */
OPERATE_RET tal_tuyaos_info_init(CHAR_T *sdk_ver, 
                                 CHAR_T *kcfg_ver, 
                                 CHAR_T *kernel_ver);

/**
 * @brief tuyaos sdk  information read
 *
 * @param[in]   none
* @return point to tuyaos sdk information
 */
CHAR_T* tal_tuyaos_info_read(VOID_T);


#ifdef __cplusplus
}
#endif

#endif

